import { Navigate } from "react-router-dom";

const Dh = (Com) =>{
    function newCom(){
        let token = localStorage.getItem('token')
        if(token){
            return <Com></Com>
        }
        else{
            return <Navigate to='/login'></Navigate>
        }
    }
    return newCom
}
export default Dh